﻿// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

using System;
using System.Windows;

namespace SongSharp.Presentation
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            SongSharp.Appliance.SongSharpApp.Start(SongSharp.Presentation.Properties.Settings.Default.DatabasePath);

            #if DEBUG
                ViewModel.PrimeViewModel primeViewModel = new ViewModel.PrimeViewModel();
            #else
            try
            {
                ViewModel.PrimeViewModel primeViewModel = new ViewModel.PrimeViewModel();
            }
            catch (Exception ex)
            {
                ViewModel.ErrorViewModel errorModel = new ViewModel.ErrorViewModel();

                errorModel.ShowWindow(ex.Message);
            }
            #endif
        }
    }
}
